<? 
require "../../../global.php";
//header('Content-Type: text/html; charset=utf-8');
echo "正在支付跳转中，请稍候.....";
?>
<FORM name="paypalments" id="paypalments"  action="https://www.paypal.com/cgi-bin/webscr/?" method=post >
<?
//此页面是jroam自行加上，用于判断定单支付列表里有没支付的记录，没有的话加上一条
$urlc="https://www.paypal.com/cgi-bin/webscr/?";
foreach($_POST as $k =>$v)
{
	$urlc=$urlc."&".$k."=".$v;
	echo "<input type='hidden' name='$k' value='$v' id='$k'>";
}
$urlc=str_replace("?&","?",$urlc);

require RootDir."/inc/dabase_mysql.php";
$mydb=new YYBDB();
$sql="select orderno from ".$SystemConest[7]."orderpaylist where orderno='".$_REQUEST["invoice"]."'";

$res=$mydb->db_query($sql);

if($mydb->db_num_rows($res)<1)
{
	
	$sql="insert into ".$SystemConest[7]."orderpaylist (tourid,orderno,paytype,earnbizhong) value(".$_REQUEST['productid'].",'".$_REQUEST["invoice"]."','payal','USD')";
	$mydb->db_query($sql);
	
}
//跳转到支付页面

//echo "<meta http-equiv=\"refresh\" content=\"0; url=".$urlc."\">";
?>
<input type="hidden" name="charset" value="utf-8">
</FORM>
<script src="/jsLibrary/jquery/jquery.js"></script>
<script  language="javascript">
$(document).ready(function(){
	$("#paypalments").submit();
});

</script>